package com.entity;

import java.io.Serializable;

/**
 * @author 
 */
public class Food implements Serializable {
    /**
     * 食物编号
     */
    private String fid;

    /**
     * 食物名称
     */
    private String fname;

    /**
     * 单价
     */
    private Float fprice;

    /**
     * 描述
     */
    private String fdesc;

    /**
     * 卡路里
     */
    private String calorie;

    /**
     * 蛋白质
     */
    private String protein;

    /**
     * 糖
     */
    private String sugar;

    /**
     * 状态
     */
    private Integer fstate;

    private static final long serialVersionUID = 1L;

    public String getFid() {
        return fid;
    }

    public void setFid(String fid) {
        this.fid = fid;
    }

    public String getFname() {
        return fname;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    public Float getFprice() {
        return fprice;
    }

    public void setFprice(Float fprice) {
        this.fprice = fprice;
    }

    public String getFdesc() {
        return fdesc;
    }

    public void setFdesc(String fdesc) {
        this.fdesc = fdesc;
    }

    public String getCalorie() {
        return calorie;
    }

    public void setCalorie(String calorie) {
        this.calorie = calorie;
    }

    public String getProtein() {
        return protein;
    }

    public void setProtein(String protein) {
        this.protein = protein;
    }

    public String getSugar() {
        return sugar;
    }

    public void setSugar(String sugar) {
        this.sugar = sugar;
    }

    public Integer getFstate() {
        return fstate;
    }

    public void setFstate(Integer fstate) {
        this.fstate = fstate;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Food other = (Food) that;
        return (this.getFid() == null ? other.getFid() == null : this.getFid().equals(other.getFid()))
            && (this.getFname() == null ? other.getFname() == null : this.getFname().equals(other.getFname()))
            && (this.getFprice() == null ? other.getFprice() == null : this.getFprice().equals(other.getFprice()))
            && (this.getFdesc() == null ? other.getFdesc() == null : this.getFdesc().equals(other.getFdesc()))
            && (this.getCalorie() == null ? other.getCalorie() == null : this.getCalorie().equals(other.getCalorie()))
            && (this.getProtein() == null ? other.getProtein() == null : this.getProtein().equals(other.getProtein()))
            && (this.getSugar() == null ? other.getSugar() == null : this.getSugar().equals(other.getSugar()))
            && (this.getFstate() == null ? other.getFstate() == null : this.getFstate().equals(other.getFstate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFid() == null) ? 0 : getFid().hashCode());
        result = prime * result + ((getFname() == null) ? 0 : getFname().hashCode());
        result = prime * result + ((getFprice() == null) ? 0 : getFprice().hashCode());
        result = prime * result + ((getFdesc() == null) ? 0 : getFdesc().hashCode());
        result = prime * result + ((getCalorie() == null) ? 0 : getCalorie().hashCode());
        result = prime * result + ((getProtein() == null) ? 0 : getProtein().hashCode());
        result = prime * result + ((getSugar() == null) ? 0 : getSugar().hashCode());
        result = prime * result + ((getFstate() == null) ? 0 : getFstate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", fid=").append(fid);
        sb.append(", fname=").append(fname);
        sb.append(", fprice=").append(fprice);
        sb.append(", fdesc=").append(fdesc);
        sb.append(", calorie=").append(calorie);
        sb.append(", protein=").append(protein);
        sb.append(", sugar=").append(sugar);
        sb.append(", fstate=").append(fstate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}